#include "serialportwindow.h"
#include "ui_serialportwindow.h"
#include <QFile>
#include <QDebug>
SerialPortWindow::SerialPortWindow(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::SerialPortWindow)
{
    ui->setupUi(this);

    //设置超链接
    //ui->label->setText("<a href=\"https://www.baidu.com/\">www.baidu.com/</a>");
    //da打开外部访问权限
    //ui->label->setOpenExternalLinks(true);

    //设置图片
    //ui->label->setText("<img src=\":/new/prefix1/img/user.jpg\" width = \"40\" />");
    //connect(ui->comboBox,SIGNAL(activated(QString)),this,SLOT(on_comboBox_activated(QString)));
    //设置图片超链接
    //ui->label->setText("<a href=\"https://www.baidu.com/\"><img src=\":/new/prefix1/img/user.jpg\" width = \"40\" /></a>");
    //ui->label->setOpenExternalLinks(true);

}

SerialPortWindow::~SerialPortWindow()
{
    delete ui;
}


void SerialPortWindow::on_comboBox_activated(const QString &arg1)
{
    QFile file(":/new/prefix1/"+arg1);
    //qDebug()<<":/new/prefix1/"+arg1;

    file.open(QIODevice::ReadOnly);
    this->setStyleSheet(file.readAll());
    file.close();
}

